<div class="form-group">
    <label class="col-sm-2 control-label" for="field-1">产品名称</label>

    <div class="col-sm-10">
        <input type="text" name="product.name" class="form-control" placeholder="请输入产品名称" data-validate="required" value="${product?.name}">
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-2">产品简称</label>

    <div class="col-sm-10">
        <input type="text" name="product.shortName" class="form-control" placeholder="请输入产品简称" data-validate="required" value="${product?.shortName}">
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label">产品类别</label>

    <div class="col-sm-10">
        <select class="form-control" name="product.productType.id" data-validate="required">
            <option value="">请选择产品类型</option>
            #{list productTypes,as:'productType'}
                <option ${productType?.id==product?.productType?.id?'selected' : ''} value="${productType.id}">${productType.name}</option>
            #{/list}
        </select>
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-3">产品图片</label>

    <div class="col-sm-10">
        <p style="color: red">注:只能上传4:3分辨率的图片</p>
        <input type="file" class="form-control" name="mainImage" id="mainImage" data-validate="${product?.mainImage == null || product?.mainImage == '' ? 'required' : ''}">
    </div>
</div>

#{if product?.mainImage != null && product?.mainImage != ''}
<div class="form-group">
    <label class="col-sm-2 control-label" for="field-3"></label>

    <div class="col-sm-10">
        <img src="${product?.mainImage}" style="width: 100px">
    </div>
</div>

#{/if}

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-5">售价</label>

    <div class="col-sm-10">
        <input type="text" class="form-control" name="product.merchantPrice" value="${product?.merchantPrice}" id="field-5" placeholder="0">
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-6">库存</label>

    <div class="col-sm-10">
        <input type="text" class="form-control" name="product.stock" value="${product?.stock}" id="field-6" placeholder="100">
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-5">商品描述</label>

    <div class="col-sm-10">
        <textarea class="form-control wysihtml5" name="product.pcContent" data-stylesheet-url="../../assets/js/wysihtml5/lib/css/wysiwyg-color.css" name="sample_wysiwyg" id="sample_wysiwyg">${product?.pcContent}</textarea>
    </div>
</div>

<div class="form-group-separator"></div>


<div class="form-group">
    <label class="col-sm-2 control-label">商品状态</label>

    <div class="col-sm-10">
        <label class="radio-inline">
            <input type="radio"  name="product.productStatus" ${product?.productStatus == enums.ProductStatus.UP ? 'checked' : ''} value="UP">
            上架
        </label>
        <label class="radio-inline">
            <input type="radio"  name="product.productStatus" ${product?.productStatus == enums.ProductStatus.DOWN ? 'checked' : ''} value="DOWN">
            下架
        </label>
    </div>
</div>

<div class="form-group-separator"></div>

<div class="form-group">
    <label class="col-sm-2 control-label" for="field-5"></label>

    <div class="col-sm-10">
        <button type="submit" class="btn btn-success">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>
        <button type="reset" class="btn btn-white">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
    </div>

</div>